﻿using MiniFox.Components;
using System.IO;
using System.Text;
using System.Threading.Tasks;

namespace TemplateEngine
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister, SpareComponent(typeof(DefaultTemplateService))]
    public interface ITemplateService
    {
        /// <summary>
        /// 
        /// </summary>
        Encoding TemplateEncoding { get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <param name="templateContent"></param>
        /// <returns></returns>
        string Resolve(object model, string templateContent);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <param name="templateContent"></param>
        /// <returns></returns>
        Task<string> ResolveAsync(object model, string templateContent);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        string Resolve(string name, object model);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<string> ResolveAsync(string name, object model);
    }
}
